import ft_dialog from '@/components/FtDialog/ft_dialog'
import { mapState, mapGetters, mapMutations } from 'vuex'

export default {
  components: {
    ft_dialog
  },
  data () {
    return {
      title: '你今天想解决什么问题？',
      answer_title: '确定',
      visible: true,
      show_message: true
    }
  },
  computed: {
    ...mapState({
      number: ({
        homePage
      }) => homePage.number,
      question: ({
        homePage
      }) => homePage.question
    }),
    ...mapGetters([
      'visibleDialog'
    ])
  },
  methods: {
    ...mapMutations([
      'SAVE_ANSWER' // 直接引用
    ]),
    handleSubmit (answer) {
      this.SAVE_ANSWER(answer)
      return true
    },
    visibleMessage () {
      this.show_message = !this.show_message
    }
  },
  mounted () {
    this.$store.commit('CHANGE_NUMBER', {
      amount: 1
    })
  }
}
